/*
 * clog_thread_local.h
 *
 *  Created on: 2012-8-22
 *      Author: lin
 */

#ifndef CLOG_THREAD_LOCAL_H_
#define CLOG_THREAD_LOCAL_H_

#include "collection/int_map.h"
#include "clog_thread_category.h"
#include "clog_conf.h"
#include "clog_category.h"
#include "clog_event.h"

typedef struct {
    clog_conf_t *conf;
    int_map_t *thread_category_table;
    clog_event_t event;
} clog_thread_local_t;

clog_thread_local_t *clog_thread_local_new(const clog_conf_t *conf);
void clog_thread_local_update(clog_thread_local_t *local,const clog_conf_t *conf);
clog_thread_category_t *clog_thread_local_get_tcategory(const clog_category_t *cat);

#define clog_thread_local_get_conf(local) (local)->conf
#endif /* CLOG_THREAD_LOCAL_H_ */
